<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>文章内容列表-添加文章</title>
    <script language="JavaScript" src="/zhenze/Public/admin/js/jquery.js"></script>
    <script type="text/javascript" src="/zhenze/Public/admin/js/jquery.js"></script>
    <script type="text/javascript" src="/zhenze/Public/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="/zhenze/Public/validform/Validform_v5.3.2.js"></script>
    <script type="text/javascript" src="/zhenze/Public/validform/Validform_Datatype.js"></script>
    <script type="text/javascript" src="/zhenze/Public/admin/js/jquery.idTabs.min.js"></script>
    <script type="text/javascript" src="/zhenze/Public/admin/js/select-ui.min.js"></script>
    <link type="text/css" href="/zhenze/Public/admin/css/style.css" rel="stylesheet"/>
    <link href="/zhenze/Public/validform/Validform.css" rel="stylesheet" type="text/css"/>
    <link href="/zhenze/Public/admin/css/select.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/zhenze/Public/kindeditor/themes/default/default.css" />
    <script type="text/javascript" src="/zhenze/Public/kindeditor/kindeditor-min.js"></script>
    <script type="text/javascript" src="/zhenze/Public/kindeditor/lang/zh-CN.js"></script>
    <script type="text/javascript">
        var editor;
        KindEditor.ready(function(K) {
            editor = K.create('textarea[id="content"]', {
                        uploadJson : '<?php echo U('kindeditor/upload_json',array('dir'=>image));?>',
                    fileManagerJson : '<?php echo U('kindeditor/file_manager_json');?>',
                    allowFileManager : true,
                    urlType : 'domain',
                    afterCreate : function() {
                this.sync();
            },
            afterBlur:function(){
                this.sync();
            }
        });

            var uploadbutton = K.uploadbutton({
                        button : K('#uploadButton')[0],
                        fieldName : 'imgFile',
                        url : '<?php echo U('kindeditor/upload_json',array('dir'=>image));?>',
                    afterUpload : function(data) {
                if (data.error === 0) {
                    var url = K.formatUrl(data.url, 'domain');
                    K('#image').val(url);
                } else {
                    alert(data.message);
                }
            },
            afterError : function(str) {
                alert('自定义错误信息: ' + str);
            }
        });
            uploadbutton.fileBox.change(function(e) {
                uploadbutton.submit();
            });
        });
        $(document).ready(function(e) {
            $("#classtype").uedSelect({
                width : 150
            });
        });
    </script>
</head>

<body>

<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="<?php echo U('index/index');?>">首页</a></li>
        <li><a href="<?php echo U('content/index');?>">文章内容列表</a></li>
        <li><a href="#">添加文章</a></li>
    </ul>
</div>

<div class="formbody">

    <div class="formtitle"><span>添加活动信息</span></div>

    <form name="myform" id="myform" action="<?php echo U('Eventinfo/insertEventinfo');?>" method="post">
        <ul class="forminfo">
            <li><label>活动标题</label><input name="event_title" id="title" type="text" class="dfinput" datatype="*" errormsg="标题不能为空！" maxlength="50" value="<?php echo ($EventInfo["event_title"]); ?>" /><i class="Validform_checktip"></i></li>
            <div class="time">
                <li class="timeDate"><label>开始时间</label><input name="event_endtime"  type="text" class="event_time"   onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})"/></li>
                <li class="timeDate"><label>结束时间</label><input name="event_starttime"  type="text" class="event_time" onfocus="WdatePicker({dateFmt: 'yyyy-MM-dd'})"></li>
            </div>
            <li><label>活动图片</label><input name="" id="image" type="text" class="dfinput" value="<?php echo ($EventInfo["event_image"]); ?>" readonly/>&nbsp;<input type="button" id="uploadButton" value="上传" /><i class="Validform_checktip"></i></li>
            <li><label>参与人数</label><input name="event_num"  type="text" class="dfinput event_time" value="<?php echo ($EventInfo["event_num"]); ?>"/></li>
            <li><label>所属商家</label><input name="event_admin"  type="text" class="dfinput event_time" value="<?php echo ($EventInfo["event_admin"]); ?>"/></li>
            <li><label>活动内容</label><textarea name="event_content" id="content" cols="" rows="" class="textinput" style="height: 250px;width:700px;"><?php echo ($EventInfo["event_content"]); ?></textarea></li>
            <li><label>&nbsp;</label><input name="btn" type="submit" class="btn" value="确认保存"/></li>
        </ul>
    </form>
</div>
<script>
    $(function(){
        $("#myform").Validform({
            //tiptype:2
            tiptype:function(msg,o,cssctl){
                var objtip=o.obj.siblings(".Validform_checktip");
                cssctl(objtip,o.type);
                objtip.text(msg);
            }
        });
    });
</script>
</body>

</html>